<?php /*a:2:{s:50:"F:\CaOadmin\application\admin\view\admin\list.html";i:1569485302;s:37:"../application/admin/view/layout.html";i:1569485205;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title><?php echo htmlentities($title); ?></title>

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico">
    <link href="<?php echo staticResource('css/bootstrap.min.css?v=3.3.6'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('css/font-awesome.min.css?v=4.4.0'); ?>" rel="stylesheet">
    
<link href="<?php echo staticResource('css/plugins/iCheck/custom.css'); ?>" rel="stylesheet">

    <link href="<?php echo staticResource('css/animate.css'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('css/style.css?v=4.1.0'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('extend/common.css'); ?>" rel="stylesheet">
</head>

<body class="fixed-sidebar full-height-layout gray-bg">


<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="row">
                    <div class="col-sm-3 m-b-xs">
                        <select class="form-control inline" id="role_select">
                            <option value="0">全部角色</option>
                            <?php foreach($roles as $k =>$r): ?>
                            <option value="<?php echo htmlentities($k); ?>" <?php if($role_check == $k): ?> selected <?php endif; ?>><?php echo htmlentities($r); ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    <div class="col-sm-6 m-b-xs">

                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <input type="text" placeholder="请输入关键词" class="form-control" id="key" value="<?php echo htmlentities($key); ?>">
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-primary" onclick="search()"> 搜索</button>
                            </span>
                        </div>
                    </div>
                </div>
                <div class="table-responsive">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <button type="button" class="btn btn-primary" onclick="pop_iframe('添加用户',`<?php echo url('admin/admin/add'); ?>`)"> 添加用户 </button>
                            <button type="button" class="btn btn-danger" id="delete_more"> 批量删除 </button>
                        </div>
                        <div class="ibox-content">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th><input type="checkbox" class="i-checks" id="check_all"></th>
                                    <th>ID</th>
                                    <th>头像</th>
                                    <th>登录名</th>
                                    <th>角色</th>
                                    <th>手机</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <form id="check_ids" action="<?php echo url('admin/admin/del'); ?>">
                                        <?php foreach($data as $v): ?>
                                        <tr>
                                            <td>
                                                <input type="checkbox" class="i-checks" value="<?php echo htmlentities($v['id']); ?>" name="id[]">
                                            </td>
                                            <td><?php echo htmlentities($v['id']); ?></td>
                                            <td><img src="<?php echo htmlentities($v['image']); ?>" alt="" style="height: 50px;width: 50px;"></td>
                                            <td><?php echo htmlentities($v['login_name']); ?></td>
                                            <td><?php echo htmlentities($v['role_id']); ?></td>
                                            <td><?php echo htmlentities($v['mobile']); ?></td>
                                            <td>
                                                <div class="switch">
                                                    <div class="onoffswitch">
                                                        <input type="checkbox"  class="onoffswitch-checkbox" data-url="<?php echo url('admin/admin/status'); ?>" data-id="<?php echo htmlentities($v['id']); ?>" id="sw-<?php echo htmlentities($v['id']); ?>" <?php if($v['status'] == 1): ?>checked<?php endif; ?>>
                                                        <label class="onoffswitch-label" for="sw-<?php echo htmlentities($v['id']); ?>">
                                                            <span class="onoffswitch-inner"></span>
                                                            <span class="onoffswitch-switch"></span>
                                                        </label>
                                                    </div>
                                                </div>
                                            </td>
                                            <td>
                                                <a href="javascript:;" onclick="pop_iframe('编辑用户',`<?php echo url('admin/admin/edit',['id' => $v['id']]); ?>`)" class="option-btn" title="编辑"><i class="glyphicon glyphicon-pencil text-navy"></i></a>
                                                <?php if($v['role_id'] != '超级管理员'): ?>
                                                <a href="javascript:;" class="option-btn delete-one" title="删除" data-url="<?php echo url('admin/admin/del'); ?>" data-id="<?php echo htmlentities($v['id']); ?>"><i class="glyphicon glyphicon-trash text-navy"></i></a>
                                                <?php endif; ?>
                                            </td>
                                        </tr>
                                        <?php endforeach; ?>
                                    </form>
                                </tbody>
                            </table>
                        </div>
                        <?php echo $data; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>





<!-- 全局js -->
<script src="<?php echo staticResource('js/jquery.min.js?v=2.1.4'); ?>"></script>
<script src="<?php echo staticResource('js/bootstrap.min.js?v=3.3.6'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/metisMenu/jquery.metisMenu.js'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/slimscroll/jquery.slimscroll.min.js'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/layer/layer.min.js'); ?>"></script>
<script src="<?php echo staticResource('extend/common.js'); ?>"></script>

<!-- 自定义js -->

<!--选择框JS-->
<script src="<?php echo staticResource('js/plugins/iCheck/icheck.min.js'); ?>"></script>

<script>

    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });

    });

    // 搜索
    function search() {
        var select = $('#role_select').val();
        var key = $('#key').val();
        location.replace("<?php echo url('admin/admin/list'); ?>" + '?role=' + select + '&key=' + key);
    }
</script>


</body>

</html>
